package com.joven.core.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * @author joven_wong
 * 2021/5/26 14:48
 */
@ApiModel
@Data
@ToString
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class User implements Serializable {

    @ApiModelProperty(name="id", dataType="Long", value="主键ID")
    @TableId(type = IdType.AUTO) //主键自增 数据库中需要设置主键自增
    private Long id;

    @ApiModelProperty(name="name", dataType="String", value="姓名")
    private String name;
    @ApiModelProperty(name="age", dataType="String", value="年龄")
    private String age;
    @ApiModelProperty(name="addr", dataType="String", value="联系地址")
    private String addr;

    @ApiModelProperty(name="email", dataType="String", value="邮箱地址")
    private String email;

    @ApiModelProperty(name="createTime", dataType="Date", value="创建时间")
    @TableField(fill = FieldFill.INSERT)// 字段添加填充内容
    private Date createTime;

    @ApiModelProperty(name="updateTime", dataType="Date", value="更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
}
